<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<title>Verbs Element</title>
<link href="../docs-assets/Breadcrumbs.css" rel="stylesheet" rev="stylesheet" type="text/css">
		<meta name="viewport" content="width=device-width initial-scale=1">
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
		<meta http-equiv="Content-Language" content="en-gb">

<link href="../docs-assets/Contents.css" rel="stylesheet" rev="stylesheet" type="text/css">
<link href="../docs-assets/Progress.css" rel="stylesheet" rev="stylesheet" type="text/css">
<link href="../docs-assets/Navigation.css" rel="stylesheet" rev="stylesheet" type="text/css">
<link href="../docs-assets/Fonts.css" rel="stylesheet" rev="stylesheet" type="text/css">
<link href="../docs-assets/Base.css" rel="stylesheet" rev="stylesheet" type="text/css">
<script>
function togglePopup(material_id) {
  var popup = document.getElementById(material_id);
  popup.classList.toggle("show");
}
</script>

<link href="../docs-assets/Popups.css" rel="stylesheet" rev="stylesheet" type="text/css">
<link href="../docs-assets/Colours.css" rel="stylesheet" rev="stylesheet" type="text/css">
		
	</head>
	<body class="commentary-font">
		<nav role="navigation">
		<h1><a href="../index.html"><img src="../docs-assets/Inform.png" height=72> </a></h1>
<ul><li><a href="../index.html">home</a></li>
</ul><h2>Compiler</h2><ul>
<li><a href="../structure.html">structure</a></li>
<li><a href="../inbuildn.html">inbuild</a></li>
<li><a href="../inform7n.html">inform7</a></li>
<li><a href="../intern.html">inter</a></li>
<li><a href="../services.html">services</a></li>
<li><a href="../secrets.html">secrets</a></li>
</ul><h2>Other Tools</h2><ul>
<li><a href="../inblorbn.html">inblorb</a></li>
<li><a href="../inform6.html">inform6</a></li>
<li><a href="../inpolicyn.html">inpolicy</a></li>
</ul><h2>Resources</h2><ul>
<li><a href="../extensions.html">extensions</a></li>
<li><a href="../kits.html">kits</a></li>
</ul><h2>Repository</h2><ul>
<li><a href="https://github.com/ganelson/inform"><img src="../docs-assets/github.png" height=0> github</a></li>
</ul><h2>Related Projects</h2><ul>
<li><a href="https://github.com/ganelson/inweb"><img src="../docs-assets/github.png" height=0> inweb</a></li>
<li><a href="https://github.com/ganelson/intest"><img src="../docs-assets/github.png" height=0> intest</a></li>
</ul>
		</nav>
		<main role="main">
		<!-- Weave of 'Verbs Element' generated by inweb -->
<div class="breadcrumbs">
    <ul class="crumbs"><li><a href="../index.html">Home</a></li><li><a href="../intern.html">Inter Modules</a></li><li><a href="index.html">index</a></li><li><a href="index.html#3">Chapter 3: Elements</a></li><li><b>Verbs Element</b></li></ul></div>
<p class="purpose">To write the Verbs element (Vb) in the index.</p>

<p class="commentary firstcommentary"><a id="SP1" class="paragraph-anchor"></a><b>&#167;1. </b>This is an uninspired corner of the index, but it's hard to think what would
be more usefully informative.
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">void</span><span class="plain-syntax"> </span><span class="function-syntax">VerbsElement::render</span><button class="popup" onclick="togglePopup('usagePopup1')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup1">Usage of <span class="code-font"><span class="function-syntax">VerbsElement::render</span></span>:<br/>The Periodic Table - <a href="3-tpt.html#SP4">&#167;4</a></span></button><span class="plain-syntax">(</span><span class="identifier-syntax">OUTPUT_STREAM</span><span class="plain-syntax">, </span><span class="reserved-syntax">index_session</span><span class="plain-syntax"> *</span><span class="identifier-syntax">session</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">localisation_dictionary</span><span class="plain-syntax"> *</span><span class="identifier-syntax">LD</span><span class="plain-syntax"> = </span><a href="1-ia.html#SP10" class="function-link"><span class="function-syntax">Indexing::get_localisation</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">session</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">HTML_OPEN</span><span class="plain-syntax">(</span><span class="string-syntax">"p"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">Localisation::italic</span><span class="plain-syntax">(</span><span class="identifier-syntax">OUT</span><span class="plain-syntax">, </span><span class="identifier-syntax">LD</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"Index.Elements.Vb.About"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">HTML_CLOSE</span><span class="plain-syntax">(</span><span class="string-syntax">"p"</span><span class="plain-syntax">);</span>

<span class="plain-syntax">    </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">verb_count</span><span class="plain-syntax"> = </span><span class="constant-syntax">0</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">inter_lexicon</span><span class="plain-syntax"> *</span><span class="identifier-syntax">lexicon</span><span class="plain-syntax"> = </span><a href="1-ia.html#SP12" class="function-link"><span class="function-syntax">Indexing::get_lexicon</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">session</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">for</span><span class="plain-syntax"> (</span><span class="reserved-syntax">index_lexicon_entry</span><span class="plain-syntax"> *</span><span class="identifier-syntax">lex</span><span class="plain-syntax"> = </span><span class="identifier-syntax">lexicon</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">first</span><span class="plain-syntax">; </span><span class="identifier-syntax">lex</span><span class="plain-syntax">; </span><span class="identifier-syntax">lex</span><span class="plain-syntax"> = </span><span class="identifier-syntax">lex</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">sorted_next</span><span class="plain-syntax">)</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">lex</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">part_of_speech</span><span class="plain-syntax"> == </span><span class="constant-syntax">VERB_TLEXE</span><span class="plain-syntax">) ||</span>
<span class="plain-syntax">            (</span><span class="identifier-syntax">lex</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">part_of_speech</span><span class="plain-syntax"> == </span><span class="constant-syntax">MVERB_TLEXE</span><span class="plain-syntax">) ||</span>
<span class="plain-syntax">            (</span><span class="identifier-syntax">lex</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">part_of_speech</span><span class="plain-syntax"> == </span><span class="constant-syntax">PREP_TLEXE</span><span class="plain-syntax">)) {</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">text_stream</span><span class="plain-syntax"> *</span><span class="identifier-syntax">entry_text</span><span class="plain-syntax"> = </span><span class="identifier-syntax">lex</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">lemma</span><span class="plain-syntax">;</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">HTML_OPEN_WITH</span><span class="plain-syntax">(</span><span class="string-syntax">"p"</span><span class="plain-syntax">, </span><span class="string-syntax">"class=\"hang\""</span><span class="plain-syntax">);</span>
<span class="plain-syntax">            </span><a href="2-iu.html#SP5" class="function-link"><span class="function-syntax">IndexUtilities::anchor_numbered</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">OUT</span><span class="plain-syntax">, </span><span class="constant-syntax">10000</span><span class="plain-syntax">+</span><span class="identifier-syntax">verb_count</span><span class="plain-syntax">++); </span><span class="comment-syntax"> anchors from 10000: see above</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">text_stream</span><span class="plain-syntax"> *</span><span class="identifier-syntax">key</span><span class="plain-syntax">;</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">lex</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">part_of_speech</span><span class="plain-syntax"> == </span><span class="constant-syntax">VERB_TLEXE</span><span class="plain-syntax">) </span><span class="identifier-syntax">key</span><span class="plain-syntax"> = </span><span class="identifier-syntax">I</span><span class="string-syntax">"Index.Elements.Vb.To"</span><span class="plain-syntax">;</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">else</span><span class="plain-syntax"> </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">lex</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">part_of_speech</span><span class="plain-syntax"> == </span><span class="constant-syntax">MVERB_TLEXE</span><span class="plain-syntax">) </span><span class="identifier-syntax">key</span><span class="plain-syntax"> = </span><span class="identifier-syntax">I</span><span class="string-syntax">"Index.Elements.Vb.To"</span><span class="plain-syntax">;</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">else</span><span class="plain-syntax"> </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">lex</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">part_of_speech</span><span class="plain-syntax"> == </span><span class="constant-syntax">PREP_TLEXE</span><span class="plain-syntax">) </span><span class="identifier-syntax">key</span><span class="plain-syntax"> = </span><span class="identifier-syntax">I</span><span class="string-syntax">"Index.Elements.Vb.ToBe"</span><span class="plain-syntax">;</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">else</span><span class="plain-syntax"> </span><span class="identifier-syntax">key</span><span class="plain-syntax"> = </span><span class="identifier-syntax">I</span><span class="string-syntax">"Index.Elements.Vb.ToBeAbleTo"</span><span class="plain-syntax">;</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">Localisation::roman_t</span><span class="plain-syntax">(</span><span class="identifier-syntax">OUT</span><span class="plain-syntax">, </span><span class="identifier-syntax">LD</span><span class="plain-syntax">, </span><span class="identifier-syntax">key</span><span class="plain-syntax">, </span><span class="identifier-syntax">entry_text</span><span class="plain-syntax">);</span>
<span class="plain-syntax">            </span><a href="2-iu.html#SP2" class="function-link"><span class="function-syntax">IndexUtilities::link_package</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">OUT</span><span class="plain-syntax">, </span><span class="identifier-syntax">lex</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">lex_package</span><span class="plain-syntax">);</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">WRITE</span><span class="plain-syntax">(</span><span class="string-syntax">" ... "</span><span class="plain-syntax">);</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">lex</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">part_of_speech</span><span class="plain-syntax"> == </span><span class="constant-syntax">MVERB_TLEXE</span><span class="plain-syntax">)</span>
<span class="plain-syntax">                </span><span class="identifier-syntax">Localisation::italic</span><span class="plain-syntax">(</span><span class="identifier-syntax">OUT</span><span class="plain-syntax">, </span><span class="identifier-syntax">LD</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"Index.Elements.Vb.ForSayingOnly"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">else</span><span class="plain-syntax"> </span><span class="identifier-syntax">WRITE</span><span class="plain-syntax">(</span><span class="string-syntax">"%S"</span><span class="plain-syntax">, </span><span class="identifier-syntax">Metadata::optional_textual</span><span class="plain-syntax">(</span><span class="identifier-syntax">lex</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">lex_package</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"^meaning"</span><span class="plain-syntax">));</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">HTML_CLOSE</span><span class="plain-syntax">(</span><span class="string-syntax">"p"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">            </span><a href="3-ve2.html#SP1" class="function-link"><span class="function-syntax">VerbsElement::tabulate</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">OUT</span><span class="plain-syntax">, </span><span class="identifier-syntax">lex</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"^present"</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"Index.Elements.Vb.Present"</span><span class="plain-syntax">, </span><span class="identifier-syntax">LD</span><span class="plain-syntax">);</span>
<span class="plain-syntax">            </span><a href="3-ve2.html#SP1" class="function-link"><span class="function-syntax">VerbsElement::tabulate</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">OUT</span><span class="plain-syntax">, </span><span class="identifier-syntax">lex</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"^past"</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"Index.Elements.Vb.Past"</span><span class="plain-syntax">, </span><span class="identifier-syntax">LD</span><span class="plain-syntax">);</span>
<span class="plain-syntax">            </span><a href="3-ve2.html#SP1" class="function-link"><span class="function-syntax">VerbsElement::tabulate</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">OUT</span><span class="plain-syntax">, </span><span class="identifier-syntax">lex</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"^present_perfect"</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"Index.Elements.Vb.Perfect"</span><span class="plain-syntax">, </span><span class="identifier-syntax">LD</span><span class="plain-syntax">);</span>
<span class="plain-syntax">            </span><a href="3-ve2.html#SP1" class="function-link"><span class="function-syntax">VerbsElement::tabulate</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">OUT</span><span class="plain-syntax">, </span><span class="identifier-syntax">lex</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"^past_perfect"</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"Index.Elements.Vb.PastPerfect"</span><span class="plain-syntax">, </span><span class="identifier-syntax">LD</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        }</span>
<span class="plain-syntax">}</span>

<span class="reserved-syntax">void</span><span class="plain-syntax"> </span><span class="function-syntax">VerbsElement::tabulate</span><span class="plain-syntax">(</span><span class="identifier-syntax">OUTPUT_STREAM</span><span class="plain-syntax">, </span><span class="reserved-syntax">index_lexicon_entry</span><span class="plain-syntax"> *</span><span class="identifier-syntax">lex</span><span class="plain-syntax">, </span><span class="identifier-syntax">text_stream</span><span class="plain-syntax"> *</span><span class="identifier-syntax">key</span><span class="plain-syntax">,</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">text_stream</span><span class="plain-syntax"> *</span><span class="identifier-syntax">tense</span><span class="plain-syntax">, </span><span class="identifier-syntax">localisation_dictionary</span><span class="plain-syntax"> *</span><span class="identifier-syntax">LD</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">text_stream</span><span class="plain-syntax"> *</span><span class="identifier-syntax">val</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Metadata::optional_textual</span><span class="plain-syntax">(</span><span class="identifier-syntax">lex</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">lex_package</span><span class="plain-syntax">, </span><span class="identifier-syntax">key</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Str::len</span><span class="plain-syntax">(</span><span class="identifier-syntax">key</span><span class="plain-syntax">) &gt; </span><span class="constant-syntax">0</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">HTML::open_indented_p</span><span class="plain-syntax">(</span><span class="identifier-syntax">OUT</span><span class="plain-syntax">, </span><span class="constant-syntax">2</span><span class="plain-syntax">, </span><span class="string-syntax">"tight"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">WRITE</span><span class="plain-syntax">(</span><span class="string-syntax">"&lt;i&gt;"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">Localisation::italic</span><span class="plain-syntax">(</span><span class="identifier-syntax">OUT</span><span class="plain-syntax">, </span><span class="identifier-syntax">LD</span><span class="plain-syntax">, </span><span class="identifier-syntax">tense</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">WRITE</span><span class="plain-syntax">(</span><span class="string-syntax">"&lt;/i&gt;&amp;nbsp;%S"</span><span class="plain-syntax">, </span><span class="identifier-syntax">val</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">HTML_CLOSE</span><span class="plain-syntax">(</span><span class="string-syntax">"p"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">}</span>
</pre>
<nav role="progress"><div class="progresscontainer">
    <ul class="progressbar"><li class="progressprev"><a href="3-ve.html">&#10094;</a></li><li class="progresschapter"><a href="P-wtmd.html">P</a></li><li class="progresschapter"><a href="1-im.html">1</a></li><li class="progresschapter"><a href="2-il.html">2</a></li><li class="progresscurrentchapter">3</li><li class="progresssection"><a href="3-tpt.html">tpt</a></li><li class="progresssection"><a href="3-ae.html">ae</a></li><li class="progresssection"><a href="3-ae2.html">ae2</a></li><li class="progresssection"><a href="3-be.html">be</a></li><li class="progresssection"><a href="3-ce.html">ce</a></li><li class="progresssection"><a href="3-ce2.html">ce2</a></li><li class="progresssection"><a href="3-ce3.html">ce3</a></li><li class="progresssection"><a href="3-ce4.html">ce4</a></li><li class="progresssection"><a href="3-ee.html">ee</a></li><li class="progresssection"><a href="3-ee2.html">ee2</a></li><li class="progresssection"><a href="3-fe.html">fe</a></li><li class="progresssection"><a href="3-ge.html">ge</a></li><li class="progresssection"><a href="3-ge2.html">ge2</a></li><li class="progresssection"><a href="3-ie.html">ie</a></li><li class="progresssection"><a href="3-le.html">le</a></li><li class="progresssection"><a href="3-me.html">me</a></li><li class="progresssection"><a href="3-pe.html">pe</a></li><li class="progresssection"><a href="3-pe2.html">pe2</a></li><li class="progresssection"><a href="3-re.html">re</a></li><li class="progresssection"><a href="3-rfse.html">rfse</a></li><li class="progresssection"><a href="3-se.html">se</a></li><li class="progresssection"><a href="3-te.html">te</a></li><li class="progresssection"><a href="3-te2.html">te2</a></li><li class="progresssection"><a href="3-ve.html">ve</a></li><li class="progresscurrent">ve2</li><li class="progresschapter"><a href="4-mc.html">4</a></li><li class="progressnext"><a href="4-mc.html">&#10095;</a></li></ul></div>
</nav><!-- End of weave -->

		</main>
	</body>
</html>

